\tikzstyle{activity}=[rectangle, draw=black, rounded corners, text centered, text width=9em, fill=white, drop shadow]
\tikzstyle{data}=[rectangle, draw=black, text centered, fill=black!10, text width=9em, drop shadow]
\tikzstyle{myarrow}=[->, thick]
\begin{tikzpicture}[align=center,node distance=3.7cm]
	
	\node (perf) [data] {Performance Data: $\mathcal{I} \times \mathcal{A} \to \mathbb{R}$};
	\node (feat) [data, below of=perf, yshift=2.3cm] {Feature Data: $f: \mathcal{I} \to \mathcal{F}$};
	\node (cost) [data, below of=feat, yshift=2.3cm] {Feature Costs: $c: \mathcal{F} \to \mathbb{R}$};
	
	\node (train) [activity, right of=feat] {Train\\ $s: \mathcal{F} \to \mathcal{A} \times \mathcal{R}$};
	
	\node (run) [activity, right of=train, xshift=0.5cm] {Select $a^*, r = s(f(i))$ and apply $a^*$ to $i$ with resources $r$};
	\node (feat_i) [activity, above of=run, yshift=-2.0cm] {Compute Features $f(i) \in \mathcal{F}$ of $i$ for cost $c(f(i))$};
	\node (inst) [data, above of=feat_i, yshift=-2.3cm] {(New) Instance $i$};
	
	\node (eva) [activity, below of=run, yshift=2.3cm] {Evaluate $m(i, a^*)$};
	
	\draw[myarrow] (perf) -| (train.north);
	\draw[myarrow] (feat) -- (train.west);
	\draw[myarrow] (cost) -| (train.south);
	
	\draw[myarrow] (inst) -- (feat_i);
	\draw[myarrow] (feat_i) -- (run);
	\draw[myarrow] (train) -- (run);
	\draw[myarrow] (run) -- (eva);
	\draw[myarrow, dashed, color=black!60] (eva.east) -- ($(eva.east)+(0.4,0.0)$) |- node [right, yshift=-0.7cm, color=black!60] {Feedback} (run.east);
	
	\path (train.east -| train.east)+(0.4,4.2) node (a) {};
    \path (train.east |- train.east)+(0.4,-2.5) node(b) {};
    \draw[dashed, color=black!60] (a) -- (b);
    \path[color=black!60] (train.east -| train.east)+(-0.3,3.8) node (a) {Offline};
    \path[color=black!60] (train.east -| train.east)+(1.0,3.8) node (a) {Online};
	
\end{tikzpicture}
